package com.example.teacher.Service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.common.domain.pojo.ClassTeacher;
import com.example.common.utils.CacheClient;
import com.example.teacher.Service.ClassTeacherService;
import com.example.teacher.mapper.ClassTeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassTeacherServiceImpl extends ServiceImpl<ClassTeacherMapper, ClassTeacher> implements ClassTeacherService {
    @Autowired
    private ClassTeacherMapper classTeacherMapper;
    @Autowired
    private CacheClient cacheClient;

    @Override
    public List<ClassTeacher> getClassById(String teacherId) {
        // 构建查询条件
        LambdaQueryWrapper<ClassTeacher> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ClassTeacher::getTeacherId, teacherId);
        // 执行查询
        return classTeacherMapper.selectList(queryWrapper);
    }


}
